package com.tianhui.consignortwofei.bugly;

import android.content.Context;

import com.tencent.bugly.Bugly;
import com.tencent.bugly.beta.Beta;
import com.tianhui.consignortwofei.BuildConfig;

/**
 * @author fgs
 * @date 2020/10/26
 * @description
 **/
public class BugLyHotUpdate implements IHotUpdate {
    @Override
    public void init(Context context) {
        if (BuildConfig.FLAVOR.equals("formal")) {
            //热更新
            // 设置是否提示用户重启，默认为false
            Beta.canNotifyUserRestart = true;
            // 调试时，将第三个参数改为true
            Bugly.init(context, "2e72c83c2f", false);
        }
    }

    @Override
    public void installTinker() {
        if (BuildConfig.FLAVOR.equals("formal")) {
            // 安装tinker
            Beta.installTinker();
        }
    }

    @Override
    public void checkUpgrade() {
        if (BuildConfig.FLAVOR.equals("formal")) {
            //热更新检查
            Beta.checkUpgrade(false, false);
        }
    }
}
